package org.eenie.qeasy;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class ConfigAdapter extends BaseQuickAdapter<PulseConfig,BaseViewHolder> {
    public ConfigAdapter(@Nullable List<PulseConfig> data) {
        super(R.layout.item_config, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, PulseConfig item) {
        String type =  item.command.substring(5, 6);
        switch (Integer.valueOf(type)) {
            case 1:
                type = "敲打";
                break;
            case 2:
                type = "刮痧";
                break;
            case 3:
                type = "混编";
                break;
            case 4:
                type = "按摩";
                break;
            case 5:
                type = "火罐";
                break;
            case 6:
                type = "针灸";
                break;
            case 7:
                type = "捶打";
                break;
        }


        String stor = item.command.substring(6, 8);

        helper.setText(R.id.tv_desc, String.format("从 %s 开始，用 %s 力度 %s  %s 秒", item.startTime, stor, type, item.duration));
    }








}
